In [2]:
%matplotlib inline

Comparisons between different versions of skprocrustes solvers


In [3]:
import skprocrustes as skp
import time
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

1. Comparison between all solvers


In [4]:
gkbsolver = skp.GKBSolver(verbose=0)
spgsolver = skp.SPGSolver(verbose=0)
gpisolver = skp.GPISolver(verbose=0)
ebsolver = skp.EBSolver(verbose=0)
gbbsolver = skp.GBBSolver(verbose=0)
gkbgbbsolver = skp.GKBSolver(verbose=0, inner_solver='gbb')
gkbblobopsolver = skp.GKBSolver(verbose=0, bloboptest = True)

Problem 1


In [5]:
problem1 = skp.ProcrustesProblem((500,500,10,10), problemnumber=1)

Problem 1: All


In [7]:
t0 = time.time(); results1_gkb = gkbsolver.solve(problem1); t1_gkb = time.time()-t0
t0 = time.time(); results1_spg = spgsolver.solve(problem1); t1_spg = time.time()-t0
t0 = time.time(); results1_gpi = gpisolver.solve(problem1); t1_gpi = time.time()-t0
t0 = time.time(); results1_eb = ebsolver.solve(problem1); t1_eb = time.time()-t0
t0 = time.time(); results1_gbb = gbbsolver.solve(problem1); t1_gbb = time.time()-t0
t0 = time.time(); results1_gkbgbb = gkbgbbsolver.solve(problem1); t1_gkbgbb = time.time()-t0
t0 = time.time(); results1_gkbblobop = gkbblobopsolver.solve(problem1); t1_gkbblobop = time.time()-t0

Problem 1: Graph


In [12]:
gkb, spg, gpi, eb, gbb, gkbgbb, gkbblobop = plt.bar([0,1,2,3,4,5,6], [t1_gkb, t1_spg, t1_gpi, t1_eb, t1_gbb, t1_gkbgbb, t1_gkbblobop])
gkb.set_facecolor('r')
spg.set_facecolor('g')
gpi.set_facecolor('b')
eb.set_facecolor('m')
gbb.set_facecolor('y')
gkbgbb.set_facecolor('k')
gkbblobop.set_facecolor('c')
ax = plt.gca()
ax.set_xticks([0,1,2,3,4,5,6])
ax.set_xticklabels(['GKB', 'SPG', 'GPI', 'EB', 'GBB', 'GKB+GBB', 'BLOBOP'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 1')


Out[12]:
Text(0.5, 1.0, 'Problem 1')

In [13]:
gkb, spg, gpi, gbb, gkbgbb, gkbblobop = plt.bar([0,1,2,3,4,5], [t1_gkb, t1_spg, t1_gpi, t1_gbb, t1_gkbgbb, t1_gkbblobop])
gkb.set_facecolor('r')
spg.set_facecolor('g')
gpi.set_facecolor('b')
gbb.set_facecolor('y')
gkbgbb.set_facecolor('k')
gkbblobop.set_facecolor('c')
ax = plt.gca()
ax.set_xticks([0,1,2,3,4,5])
ax.set_xticklabels(['GKB', 'SPG', 'GPI', 'GBB', 'GKB+GBB', 'BLOBOP'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 1')


Out[13]:
Text(0.5, 1.0, 'Problem 1')

In [14]:
results = pd.DataFrame({'GKB' : [t1_gkb], 
                        'SPG' : [t1_spg], 
                        'GPI' : [t1_gpi], 
                        'EB' : [t1_eb], 
                        'GBB' : [t1_gbb], 
                        'GKB+GBB' : [t1_gkbgbb],
                        'GKB+BLOBOP': [t1_gkbblobop]}, index=['problem1'])
results = results.T
results


Out[14]:
problem1
GKB 0.111337
SPG 0.012094
GPI 0.043562
EB 0.968036
GBB 0.023611
GKB+GBB 0.076657
GKB+BLOBOP 0.065112

Problem 2


In [15]:
problem2 = skp.ProcrustesProblem((100,100,5,5), problemnumber=2)

Problem 2: All


In [16]:
t0 = time.time(); results2_gkb = gkbsolver.solve(problem2); t2_gkb = time.time()-t0
t0 = time.time(); results2_spg = spgsolver.solve(problem2); t2_spg = time.time()-t0
t0 = time.time(); results2_gpi = gpisolver.solve(problem2); t2_gpi = time.time()-t0
t0 = time.time(); results2_eb = ebsolver.solve(problem2); t2_eb = time.time()-t0
t0 = time.time(); results2_gbb = gbbsolver.solve(problem2); t2_gbb = time.time()-t0
t0 = time.time(); results2_gkbgbb = gkbgbbsolver.solve(problem2); t2_gkbgbb = time.time()-t0
t0 = time.time(); results2_gkbblobop = gkbblobopsolver.solve(problem2); t2_gkbblobop = time.time()-t0

In [17]:
gkb, spg, gpi, eb, gbb = plt.bar([0,1,2,3,4], [t2_gkb, t2_spg, t2_gpi, t2_eb, t2_gbb])
gkb.set_facecolor('r')
spg.set_facecolor('g')
gpi.set_facecolor('b')
eb.set_facecolor('m')
gbb.set_facecolor('y')
#gkbgbb.set_facecolor('k')
ax = plt.gca()
ax.set_xticks([0,1,2,3,4])
ax.set_xticklabels(['GKB', 'SPG', 'GPI', 'EB', 'GBB'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 2')

gkb, spg, gpi, eb, gbb, gkbgbb, gkbblobop = plt.bar([0,1,2,3,4,5,6], [t2_gkb, t2_spg, t2_gpi, t2_eb, t2_gbb, t2_gkbgbb, t2_gkbblobop])
gkb.set_facecolor('r')
spg.set_facecolor('g')
gpi.set_facecolor('b')
eb.set_facecolor('m')
gbb.set_facecolor('y')
gkbgbb.set_facecolor('k')
gkbblobop.set_facecolor('c')
ax = plt.gca()
ax.set_xticks([0,1,2,3,4,5,6])
ax.set_xticklabels(['GKB', 'SPG', 'GPI', 'EB', 'GBB', 'GKB+GBB', 'BLOBOP'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 2')


Out[17]:
Text(0.5, 1.0, 'Problem 2')

In [18]:
results['problem2'] = pd.Series([t2_gkb, t2_spg, t2_gpi, t2_eb, t2_gbb, t2_gkbgbb, t2_gkbblobop], index=results.index)
results


Out[18]:
problem1 problem2
GKB 0.111337 1.732536
SPG 0.012094 0.394459
GPI 0.043562 0.355606
EB 0.968036 12.921742
GBB 0.023611 4.137173
GKB+GBB 0.076657 6.378740
GKB+BLOBOP 0.065112 1.633111

Problem 3


In [23]:
problem3 = skp.ProcrustesProblem((500, 500, 5, 5), problemnumber=3)

Problem 3: GKB


In [24]:
t0 = time.time(); results3_gkb = gkbsolver.solve(problem3); t3_gkb = time.time()-t0
results3_gkb.show()


=========
 Summary:
=========
success : True
status : 0
message : No further progress can be made.
fun : 5.131667711540999e-06
normcrit : 0.01751056895271069
error : 0.03580606405564048
cpu : 5.796164035797119
nbiter : 1692.62
nfev : 1950.970000000002
blocksteps : 100

Problem 3: SPG


In [25]:
t0 = time.time(); results3_spg = spgsolver.solve(problem3); t3_spg = time.time()-t0; print(t3_spg)


0.04762768745422363

In [26]:
results3_spg.show()


=========
 Summary:
=========
success : True
status : 0
message : Optimization terminated successfully.
fun : 5.132780151942836e-06
normcrit : 0.0003815177725226038
error : 0.035804441667312524
cpu : 0.047443389892578125
nbiter : 34
nfev : 35.0

Problem 3: GPI


In [27]:
t0 = time.time(); results3_gpi = gpisolver.solve(problem3); t3_gpi = time.time()-t0; print(t3_gpi)


0.3965134620666504

In [28]:
results3_gpi.show()


=========
 Summary:
=========
success : True
status : 0
message : Optimization terminated successfully.
fun : 1.551334913511932e-05
normcrit : 9.974001297310054e-07
error : 0.03564933204935722
cpu : 0.39629149436950684
nbiter : 86
nfev : 87

Problem 3: EB


In [29]:
t0 = time.time(); results3_eb = ebsolver.solve(problem3); t3_eb = time.time()-t0; print(t3_eb)


18.9253568649292

In [30]:
results3_eb.show()


=========
 Summary:
=========
success : True
status : 0
message : Optimization terminated successfully.
fun : 5.131185645047931e-06
error : 0.03580563112422961
cpu : 18.92514681816101
nbiter : 220
nfev : 221

In [31]:
t0 = time.time(); results3_gbb = gbbsolver.solve(problem3); t3_gbb = time.time()-t0; print(t3_gbb)


5.637048721313477

In [32]:
results3_gbb.show()


=========
 Summary:
=========
success : True
status : 0
message : Optimization terminated successfully.
fun : 6.132167199890109e-06
error : 0.055769753038724015
cpu : 5.6368420124053955
nbiter : 3020
nfev : 10834

Problem 3: All


In [33]:
gkb, spg, gpi, eb, gbb = plt.bar([0,1,2,3,4], [t3_gkb, t3_spg, t3_gpi, t3_eb, t3_gbb])
gkb.set_facecolor('r')
spg.set_facecolor('g')
gpi.set_facecolor('b')
eb.set_facecolor('m')
gbb.set_facecolor('y')
ax = plt.gca()
ax.set_xticks([0,1,2,3,4])
ax.set_xticklabels(['GKB', 'SPG', 'GPI', 'EB', 'GBB'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 3')


Out[33]:
Text(0.5, 1.0, 'Problem 3')

In [34]:
results['problem3'] = pd.Series([t3_gkb, t3_spg, t3_gpi, t3_eb, t3_gbb, 0], index=results.index)
results


Out[34]:
problem1 problem2 problem3
GKB 0.069958 4.170301 5.796366
SPG 0.030239 1.733156 0.047628
GPI 0.057133 0.681897 0.396513
EB 0.905570 13.386660 18.925357
GBB 0.059863 5.319885 5.637049
GKB+GBB 0.071246 0.000000 0.000000

2. Comparison between blobop and old residual for GKBSolver.


In [35]:
gkbsolver_blobop = skp.GKBSolver(verbose=0, bloboptest = True)

Problem 1


In [36]:
t0 = time.time(); results1_gkbblobop = gkbsolver_blobop.solve(problem1); t1_blobop = time.time()-t0

In [37]:
results1_gkbblobop.show()


=========
 Summary:
=========
success : True
status : 0
message : Optimization terminated successfully.
fun : 2.608082314765709e-10
normcrit : 0.0001910561299554899
error : 1.1002118566061557e-06
cpu : 0.06883001327514648
nbiter : 1.1600000000000001
nfev : 2.9600000000000013
blocksteps : 5

In [38]:
results1_gkb.show()


=========
 Summary:
=========
success : True
status : 0
message : Optimization terminated successfully.
fun : 2.578793622029034e-10
normcrit : 0.00018998120729215638
error : 1.1233282908519718e-06
cpu : 0.06975817680358887
nbiter : 1.1600000000000001
nfev : 2.9600000000000013
blocksteps : 5

In [39]:
gkb, blobop = plt.bar([0,1], [t1_gkb, t1_blobop])
gkb.set_facecolor('r')
blobop.set_facecolor('y')
ax = plt.gca()
ax.set_xticks([0,1])
ax.set_xticklabels(['GKB', 'BLOBOP'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 1')


Out[39]:
Text(0.5, 1.0, 'Problem 1')

In [40]:
gkb, spg, gpi, eb, gbb, blobop = plt.bar([0,1,2,3,4,5], [t1_gkb, t1_spg, t1_gpi, t1_eb, t1_gbb, t1_blobop])
gkb.set_facecolor('r')
spg.set_facecolor('g')
gpi.set_facecolor('b')
eb.set_facecolor('m')
gbb.set_facecolor('y')
blobop.set_facecolor('k')
ax = plt.gca()
ax.set_xticks([0,1,2,3,4,5])
ax.set_xticklabels(['GKB', 'SPG', 'GPI', 'EB', 'GBB', 'BLOBOP'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 1')


Out[40]:
Text(0.5, 1.0, 'Problem 1')

In [41]:
gkb, spg, gpi, gbb, blobop = plt.bar([0,1,2,3,4], [t1_gkb, t1_spg, t1_gpi, t1_gbb, t1_blobop])
gkb.set_facecolor('r')
spg.set_facecolor('g')
gpi.set_facecolor('b')
#eb.set_facecolor('m')
gbb.set_facecolor('y')
blobop.set_facecolor('k')
ax = plt.gca()
ax.set_xticks([0,1,2,3,4])
ax.set_xticklabels(['GKB', 'SPG', 'GPI', 'GBB', 'BLOBOP'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 1')


Out[41]:
Text(0.5, 1.0, 'Problem 1')

Problem 2


In [42]:
t0 = time.time(); results2_gkbblobop = gkbsolver_blobop.solve(problem2); t2_blobop = time.time()-t0

In [43]:
results2_gkbblobop.show()


=========
 Summary:
=========
success : True
status : 0
message : No further progress can be made.
fun : 2.925400923378415e-07
normcrit : 0.022602674945456508
error : 0.002254040065187797
cpu : 2.9044535160064697
nbiter : 4153.35
nfev : 5753.200000000004
blocksteps : 20

In [44]:
results2_gkb.show()


=========
 Summary:
=========
success : True
status : 0
message : No further progress can be made.
fun : 2.1445174383833714e-07
normcrit : 0.018800891291422688
error : 0.0019578669028790818
cpu : 4.170146703720093
nbiter : 5451.1
nfev : 7778.850000000015
blocksteps : 20

In [45]:
gkb, blobop = plt.bar([0,1], [t2_gkb, t2_blobop])
gkb.set_facecolor('r')
blobop.set_facecolor('y')
ax = plt.gca()
ax.set_xticks([0,1])
ax.set_xticklabels(['GKB', 'BLOBOP'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 2')


Out[45]:
Text(0.5, 1.0, 'Problem 2')

In [46]:
gkb, spg, gpi, eb, blobop = plt.bar([0,1,2,3,4], [t2_gkb, t2_spg, t2_gpi, t2_eb, t2_blobop])
gkb.set_facecolor('r')
spg.set_facecolor('g')
gpi.set_facecolor('b')
eb.set_facecolor('m')
blobop.set_facecolor('y')
ax = plt.gca()
ax.set_xticks([0,1,2,3,4])
ax.set_xticklabels(['GKB', 'SPG', 'GPI', 'EB', 'BLOBOP'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 2')


Out[46]:
Text(0.5, 1.0, 'Problem 2')

Problem 3


In [47]:
t0 = time.time(); results3_gkbblobop = gkbsolver_blobop.solve(problem3); t3_blobop = time.time()-t0

In [48]:
results3_gkbblobop.show()


=========
 Summary:
=========
success : True
status : 0
message : No further progress can be made.
fun : 5.131667711526123e-06
normcrit : 0.017510568952651948
error : 0.03580606405564164
cpu : 5.470430135726929
nbiter : 1692.83
nfev : 1951.180000000002
blocksteps : 100

In [49]:
results3_gkb.show()


=========
 Summary:
=========
success : True
status : 0
message : No further progress can be made.
fun : 5.131667711540999e-06
normcrit : 0.01751056895271069
error : 0.03580606405564048
cpu : 5.796164035797119
nbiter : 1692.62
nfev : 1950.970000000002
blocksteps : 100

In [50]:
gkb, blobop = plt.bar([0,1], [t3_gkb, t3_blobop])
gkb.set_facecolor('r')
blobop.set_facecolor('y')
ax = plt.gca()
ax.set_xticks([0,1])
ax.set_xticklabels(['GKB', 'BLOBOP'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 3')


Out[50]:
Text(0.5, 1.0, 'Problem 3')

In [51]:
gkb, spg, gpi, eb, blobop = plt.bar([0,1,2,3,4], [t3_gkb, t3_spg, t3_gpi, t3_eb, t3_blobop])
gkb.set_facecolor('r')
spg.set_facecolor('g')
gpi.set_facecolor('b')
eb.set_facecolor('m')
blobop.set_facecolor('y')
ax = plt.gca()
ax.set_xticks([0,1,2,3,4])
ax.set_xticklabels(['GKB', 'SPG', 'GPI', 'EB', 'BLOBOP'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 3')


Out[51]:
Text(0.5, 1.0, 'Problem 3')

In [52]:
r = pd.DataFrame({'problem1' : t1_blobop, 'problem2' : t2_blobop, 'problem3' : t3_blobop}, index=['BLOBOP'])
results = results.append(r)
results


Out[52]:
problem1 problem2 problem3
GKB 0.069958 4.170301 5.796366
SPG 0.030239 1.733156 0.047628
GPI 0.057133 0.681897 0.396513
EB 0.905570 13.386660 18.925357
GBB 0.059863 5.319885 5.637049
GKB+GBB 0.071246 0.000000 0.000000
BLOBOP 0.069043 2.904620 5.470636

3. Comparison between svd and polar decomposition on GKBSolver


In [53]:
gkbpolar = skp.GKBSolver(verbose=0, polar="ns")
gkbpolarblobop = skp.GKBSolver(verbose=0, polar="ns", bloboptest=True)

Problem 1


In [54]:
t0 = time.time(); results1_gkbpolar = gkbpolar.solve(problem1); t1_gkbpolar = time.time()-t0

In [55]:
results1_gkbpolar.show()


=========
 Summary:
=========
success : True
status : 0
message : Optimization terminated successfully.
fun : 2.497367832737372e-10
normcrit : 0.00018753618499880168
error : 1.165856725168374e-06
cpu : 0.09996747970581055
nbiter : 1.1600000000000001
nfev : 2.9600000000000013
blocksteps : 5

In [56]:
t0 = time.time(); results1_gkbpolarblobop = gkbpolarblobop.solve(problem1); t1_gkbpolarblobop = time.time()-t0

In [57]:
results1_gkbpolarblobop.show()


=========
 Summary:
=========
success : True
status : 0
message : Optimization terminated successfully.
fun : 2.5171422703106026e-10
normcrit : 0.00018855805904438035
error : 1.1367281198579056e-06
cpu : 0.06825661659240723
nbiter : 1.1600000000000001
nfev : 2.9600000000000013
blocksteps : 5

In [58]:
gkb, polarblobop, polar = plt.bar([0,1,2], [t1_gkb, t1_gkbpolarblobop, t1_gkbpolar])
gkb.set_facecolor('r')
polarblobop.set_facecolor('g')
polar.set_facecolor('b')
ax = plt.gca()
ax.set_xticks([0,1,2])
ax.set_xticklabels(['GKB', 'POLAR+BLOBOP', 'POLAR'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 1')


Out[58]:
Text(0.5, 1.0, 'Problem 1')

Problem 2


In [59]:
t0 = time.time(); results2_gkbpolar = gkbpolar.solve(problem2); t2_gkbpolar = time.time()-t0

In [60]:
results2_gkbpolar.show()


=========
 Summary:
=========
success : True
status : 0
message : No further progress can be made.
fun : 4.820270216084519e-08
normcrit : 0.007214606235196402
error : 0.0011032592914477493
cpu : 3.780449867248535
nbiter : 3708.5
nfev : 5103.600000000003
blocksteps : 20

In [61]:
t0 = time.time(); results2_gkbpolarblobop = gkbpolarblobop.solve(problem2); t2_gkbpolarblobop = time.time()-t0

In [62]:
results2_gkbpolarblobop.show()


=========
 Summary:
=========
success : True
status : 0
message : No further progress can be made.
fun : 2.311772683931615e-07
normcrit : 0.019707582380820297
error : 0.0020224139550518733
cpu : 5.417364835739136
nbiter : 5371.1
nfev : 7593.850000000003
blocksteps : 20

In [63]:
gkb, polarblobop, polar = plt.bar([0,1,2], [t2_gkb, t2_gkbpolarblobop, t2_gkbpolar])
gkb.set_facecolor('r')
polarblobop.set_facecolor('g')
polar.set_facecolor('b')
ax = plt.gca()
ax.set_xticks([0,1,2])
ax.set_xticklabels(['GKB', 'POLAR+BLOBOP', 'POLAR'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 2')


Out[63]:
Text(0.5, 1.0, 'Problem 2')

Problem 3


In [64]:
t0 = time.time(); results3_gkbpolar = gkbpolar.solve(problem3); t3_gkbpolar = time.time()-t0

In [65]:
results3_gkbpolar.show()


=========
 Summary:
=========
success : True
status : 0
message : No further progress can be made.
fun : 5.1316677115433824e-06
normcrit : 0.01751056895291697
error : 0.035806064055638895
cpu : 7.435473918914795
nbiter : 1692.86
nfev : 1951.210000000002
blocksteps : 100

In [66]:
t0 = time.time(); results3_gkbpolarblobop = gkbpolarblobop.solve(problem3); t3_gkbpolarblobop = time.time()-t0

In [67]:
results3_gkbpolarblobop.show()


=========
 Summary:
=========
success : True
status : 0
message : No further progress can be made.
fun : 5.131667711539431e-06
normcrit : 0.017510568952969263
error : 0.03580606405564402
cpu : 6.525835275650024
nbiter : 1692.77
nfev : 1951.1200000000022
blocksteps : 100

In [68]:
gkb, polarblobop, polar = plt.bar([0,1,2], [t3_gkb, t3_gkbpolarblobop, t3_gkbpolar])
gkb.set_facecolor('r')
polarblobop.set_facecolor('g')
polar.set_facecolor('b')
ax = plt.gca()
ax.set_xticks([0,1,2])
ax.set_xticklabels(['GKB', 'POLAR+BLOBOP', 'POLAR'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 3')


Out[68]:
Text(0.5, 1.0, 'Problem 3')

In [69]:
r = pd.DataFrame({'problem1' : t1_gkbpolar, 'problem2' : t2_gkbpolar, 'problem3' : t3_gkbpolar}, index=['POLAR'])
results = results.append(r)
r = pd.DataFrame({'problem1' : t1_gkbpolarblobop, 'problem2' : t2_gkbpolarblobop, 'problem3' : t3_gkbpolarblobop}, index=['POLAR+BLOBOP'])
results = results.append(r)
results


Out[69]:
problem1 problem2 problem3
GKB 0.069958 4.170301 5.796366
SPG 0.030239 1.733156 0.047628
GPI 0.057133 0.681897 0.396513
EB 0.905570 13.386660 18.925357
GBB 0.059863 5.319885 5.637049
GKB+GBB 0.071246 0.000000 0.000000
BLOBOP 0.069043 2.904620 5.470636
POLAR 0.100189 3.780615 7.435705
POLAR+BLOBOP 0.068440 5.417522 6.526041

4. Comparison between all versions

Problem 1


In [70]:
gkb, blobop, polarblobop, polar, spg, gpi, eb = plt.bar([0, 1, 2, 3, 4, 5, 6], [t1_gkb, t1_blobop, t1_gkbpolarblobop, t1_gkbpolar, t1_spg, t1_gpi, t1_eb])
gkb.set_facecolor('r')
blobop.set_facecolor('k')
polarblobop.set_facecolor('g')
polar.set_facecolor('b')
spg.set_facecolor('y')
gpi.set_facecolor('m')
eb.set_facecolor('c')
ax = plt.gca()
ax.set_xticks([0,1,2,3,4,5,6])
ax.set_xticklabels(['GKB', 'BLOBOP', 'POLAR+BLOBOP', 'POLAR', 'SPG', 'GPI', 'EB'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 1')


Out[70]:
Text(0.5, 1.0, 'Problem 1')

Problem 2


In [71]:
gkb, blobop, polarblobop, polar, spg, gpi, eb = plt.bar([0, 1, 2, 3, 4, 5, 6], [t2_gkb, t2_blobop, t2_gkbpolarblobop, t2_gkbpolar, t2_spg, t2_gpi, t2_eb])
gkb.set_facecolor('r')
blobop.set_facecolor('k')
polarblobop.set_facecolor('g')
polar.set_facecolor('b')
spg.set_facecolor('y')
gpi.set_facecolor('m')
eb.set_facecolor('c')
ax = plt.gca()
ax.set_xticks([0,1,2,3,4,5,6])
ax.set_xticklabels(['GKB', 'BLOBOP', 'POLAR+BLOBOP', 'POLAR', 'SPG', 'GPI', 'EB'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 2')


Out[71]:
Text(0.5, 1.0, 'Problem 2')

Problem 3


In [72]:
gkb, blobop, polarblobop, polar, spg, gpi, eb = plt.bar([0, 1, 2, 3, 4, 5, 6], [t3_gkb, t3_blobop, t3_gkbpolarblobop, t3_gkbpolar, t3_spg, t3_gpi, t3_eb])
gkb.set_facecolor('r')
blobop.set_facecolor('k')
polarblobop.set_facecolor('g')
polar.set_facecolor('b')
spg.set_facecolor('y')
gpi.set_facecolor('m')
eb.set_facecolor('c')
ax = plt.gca()
ax.set_xticks([0,1,2,3,4,5,6])
ax.set_xticklabels(['GKB', 'BLOBOP', 'POLAR+BLOBOP', 'POLAR', 'SPG', 'GPI', 'EB'])
#ax.set_ylim([0, 100])
ax.set_ylabel('CPU Time')
ax.set_title('Problem 3')


Out[72]:
Text(0.5, 1.0, 'Problem 3')

In [ ]: